package com.xjtu.chapter08.thread;

/**
 * @author yjq
 * @version 1.0
 * @date 2021/8/30 10:59
 */
class Casher implements Runnable{
    int customer = 500;//将共享的资源

    @Override
    public void run() {
        while (customer>0){//仍有顾客
            System.out.println(Thread.currentThread().getName()+"is still open"+customer--);
        }
    }
}
public class Count {
    public static void main(String[] args) {
        Casher t = new Casher();
        new Thread(t).start();
        new Thread(t).start();
        new Thread(t).start();//开启三个线程
    }
}
